import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/users/login',
    // url: '/vue-admin-template/user/login',
    method: 'post',
    data
  })
}

export function logout() {
  return request({
    url: '/users/logout',
    method: 'get'
  })
}


export function register(data) {
  return request({
    url: '/users/register',
    // url: '/vue-admin-template/user/login',
    method: 'post',
    data
  })
}
  
//验证邮箱
export function confirmMail(username) {
  return request({
    url: '/users/confirm',
    method: 'get',
    params:{username}
  })
}

//获取验证码
export function getCode() {
  return request({
    url: '/users/code?uuid='+Math.random(),
    method: 'get',
   
  })
}
//重置邮箱
export function resetEmail(data){
  return request({
    url: '/users/reset/email',
    method: 'post',
    data
  })
}
//修改密码
export function updatePassword(data){
  return request({
    url: '/users/update/password',
    method: 'post',
    data
  })
}
//修改用户信息
export function updateUserInfo(data){
  return request({
    url: '/users/update/info',
    method: 'post',
    data
  })
}



////////////////////////////////////////
//可以不用管
export function listMyShip(pageNum,pageSize){
  return request({
    url:'/users/ship/list?pageNum='+pageNum+'&pageSize='+pageSize,
    method: 'get'
  })
}
export function listMyRecord(pageNum,pageSize){
  return request({
    url: '/users/record/list?pageNum='+pageNum+'&pageSize='+pageSize,
    method: 'get',
    
  })
}
///////////////////////////////////